﻿@using Commission.Models
@using MyResources = Commission.Resources.AppResource
@model LoginViewModel

@{
    ViewBag.Title = @MyResources.LabelLogin;
}

@section MyJavascript {
    <script type="text/javascript">
        $(document).ready(function () {
            $("input[type = 'radio']").click(function () {
                $(this).parents("form").submit(); // post form
            });
        })
    </script>
}

<h2>@ViewBag.Title</h2>
<hr />

<div class="row">
    <div class="col-md-8">
        <section id="loginForm">

            @Html.ValidationSummary(true, "", new { @class = "text-danger" })
                       
            @using (Html.BeginForm("ConfirmPassword", "Customer", new { ReturnUrl = ViewBag.ReturnUrl },
                FormMethod.Post, 
                new { @class = "form-horizontal", role = "form", @autocomplete = "off" }))
            {
                @Html.AntiForgeryToken()

                <div class="form-group">
                    @Html.Label(@MyResources.LabelUserName, new { @class = "col-md-2 control-label" })

                    <div class="col-md-10">
                        @Html.TextBoxFor(m => m.UserName, new { @class = "form-control" })
                        @Html.ValidationMessageFor(m => m.UserName, "", new { @class = "text-danger" })
                    </div>
                </div>

                <div class="form-group">
                    @Html.Label(@MyResources.LabelPassword, new { @class = "col-md-2 control-label" })
                    <div class="col-md-10">
                        @Html.PasswordFor(m => m.Password, new { @class = "form-control" })
                        @Html.ValidationMessageFor(m => m.Password, "", new { @class = "text-danger" })
                    </div>
                </div>

                <div class="form-group">
                    <div class="col-md-offset-2 col-md-10">
                        <input type="submit" value="@MyResources.LinkLogin" class="btn btn-default" />
                    </div>
                </div>
            }
        </section>
    </div>
</div>
